package org.gdkm.hystrix;


import com.google.common.collect.Lists;
import org.gdkm.constants.HttpStatusConstants;
import org.gdkm.json.MapperUtils;
import org.gdkm.util.BaseResult;

public class Rollback {
    /**
     * 上游服务器发生故障，502
     *
     * @return
     */
    public static String badGateway() {

        BaseResult baseResult = BaseResult.notOk(Lists.newArrayList(new BaseResult.Error(
                String.valueOf(HttpStatusConstants.BAD_GTAEWAY.getStatus()),
                HttpStatusConstants.BAD_GTAEWAY.getContent())));
        try {
            return MapperUtils.obj2json(baseResult);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

